function flexible (win, doc) {
    const docEl = doc.documentElement;
    const dpr = win.devicePixelRatio;
    
    doc.body.style.fontSize = (12 * dpr) + 'px';

    const rem = docEl.clientWidth / 10;  //153
    docEl.style.fontSize = rem + 'px';
}


flexible(window, document);